package reflect01;
/*
* 解剖Person类
* */
public class Person {
    public String name;
    int age = 13;

    public Person() {}

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private Person(String name) {
        this.name = name;
    }

    public void sleep(){
        System.out.println("只有睡得好，精神才能好");
    }

    public String eat(String food){
        System.out.println("人吃"+food);
        return food;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
